﻿using System;
using System.Data;
using System.Text;
using SME.Food.Surperise.BLL;

namespace SME.Food.Tricon.Web.AdminJS.MenusManage
{
    public partial class MenusList : System.Web.UI.Page
    {
        public Bas_Menus_BLL bll = new Bas_Menus_BLL();
        public  string UserNo = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            UserNo = Request.QueryString["userno"];  
            GetSingleSearch();
            BindData();
        }

        public void GetSingleSearch()
        {
            SearchMenusNo = Request.Form["SearchMenusNo"];
            SearchMenusStatue = Request.Form["SearchMenusStatue"];
        }

        public void BindData()
        {
            StringBuilder sqlWhere = new StringBuilder();
            if (!string.IsNullOrEmpty(SearchMenusNo))
            {
                sqlWhere.AppendFormat(" and Menus_No like '%{0}%'", SearchMenusNo);
            }
            if (!string.IsNullOrEmpty(SearchMenusStatue))
            {
                sqlWhere.AppendFormat(" and Menus_Statue={0}", Int32.Parse(SearchMenusStatue));
            }
            Table = bll.GetList(sqlWhere.ToString()).Tables[0];
        }

        /// <summary>
        /// 用户检索
        /// </summary>
        public string SearchMenusNo { get; set; }

        /// <summary>
        /// 是否到期
        /// </summary>
        public string PageNum { get; set; }
        /// <summary>
        /// 员工姓名检索
        /// </summary>
        public string SearchMenusStatue { get; set; }
        /// <summary>
        /// 企业编号
        /// </summary>
        public string NumPerPage { get; set; }
        /// <summary>
        /// 企业名称
        /// </summary>
        public DataTable Table { get; set; }
    }
}